<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title>图书管理系统</title>
    <link rel="stylesheet" type="text/css" href="index.css" />
    <!--<link rel="icon" hrefs="tao.ico"/>-->
</head>

<body>

    <div id="body">
        <div class="login">
            <div>
                <img src="logo.png" alt="">
            </div>

            <form action="id.php" method="POST">
                <button type="button"><a class="color" href="all.php">所有书籍</a></button>
                <button type="button"><a href="insert.html">添加书籍</a></button>
                <button type="button"><a href="revise.html">修改书名</a></button>
                <button type="button"><a href="delete.html">删除书名</a></button>
                <button type="button"><a href="id.html">修改 I D&nbsp;&nbsp; </a></button>
                <button type="button"><a href="id_password.html">修改密码</a></button>
                <button type="button"><a href="index.html">返回登录</a></button>
                <br>


            </form>
            <div class="php">
                <?php
                header('content-type:text/html;charset=utf-8');
                $host = "localhost";
                $user = "root";
                $password = "";
                $db = "library";


                $mysqli = new mysqli($host, $user, $password, $db); //实例化mysqli对象，连接mysql数据库
                if ($mysqli->connect_errno) {
                    die($mysqli->connect_error);
                }
                

                // $result = mysqli_query($mysqli,"select * from book ");
                //                 while($myrows = mysqli_fetch_array($result)){


                    echo '<table border=1px>';
                    echo '<tr width=420px height=30px><td width=100px>';

                    echo '<b>编号<b/>';
                    echo '<td width=160px>';
                    echo '<b>书名<b/>';
                    echo '</td>';

                    echo '<td width=160px>';
                    echo '<b>作者<b/>';
                    echo '</td></tr>';
                $row = mysqli_query($mysqli, 'select * from book');
                while ($myrows = mysqli_fetch_array($row)) {
                    echo '<table border=1px>';
                    echo '<tr height=40px><td width=100px>';

                    echo $myrows['number'];
                    echo '<td width=160px>';
                    echo $myrows['bookname'];
                    echo '</td>';

                    echo '<td width=160px>';
                    echo $myrows['aythor'];
                    echo '</td></tr>';
                }

                ?>
            </div>

        </div>


</body>

</html>